{% extends base %}

{% block body_left %}

<div class="card">
    <div class="card-title">
        <span>{{title}}</span>
        <div class="float-right">
            {% include note/component/share_dialog.html %}
        </div>
    </div>
</div>

<div class="card">
    <div class="x-tab-box" data-tab-default="public" data-tab-key="tab">
        <a class="tab tab-link x-tab" href="{{_server_home}}/note/public" data-tab-value="public">最近分享</a>
        <a class="tab tab-link x-tab" href="{{_server_home}}/note/public?tab=hot" data-tab-value="hot">热门分享</a>
        {% if _has_login %}
        <a class="tab tab-link x-tab" href="{{_server_home}}/note/share_to_me?tab=to_me" data-tab-value="to_me">分享给我</a>
        {% end %}
    </div>
</div>

<div class="card">

    {% if len(notes) == 0 %}
        {% include common/text/empty_text.html %}
    {% end %}

    {% for item in notes %}
        <!-- 隐藏的记录 -->
        {% if hasattr(item, "hide") and item.hide %}
            {% continue %}
        {% end %}

        <a class="list-link" href="{{_server_home}}{{item.url}}">
            <!-- 图标和标题 -->
            <i class="fa {{item.icon}} fa-{{item.icon}} black"></i>
            <span>{{item.name}}</span>

            {% if item.is_deleted %}
                <span class="gray-tag-span" href="{{_server_home}}/note/removed">删除</span>
            {% end %}
            
            <div class="float-right">
                <span class="tag gray-tag">{{item.creator}}</span>
                <span class="book-size-span">{{item.badge_info}}</span>
                <i class="fa fa-chevron-right"></i>
            </div>
        </a>
    {% end %}
</div>

{# 分页 #}
{% if "page" in globals() %}
    <div class="card">
        {% include mod_pagenation.html %}
    </div>
{% end %}

{% end %}

{% block body_right %}
    {% include note/component/sidebar/share_sidebar.html %}
{% end %}
